home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / programming / source / sftwist.lha / MStars.asm < prev    next >
Assembly Source File  |  1993-07-20  |  18KB  |  654 lines

  1. *  StarFields for MSHOW
  2.  
  3.  
  4.  
  5. ****************************************************************************
  6. * Symbol Definitions
  7. *
  8. MINBOX        equ    -450
  9. MAXBOX        equ    450
  10. BOXRANGE    equ    MAXBOX-MINBOX+1
  11.  
  12. NSTARS        equ    70        ; Must be even
  13.  
  14. MAGIC        equ    (256<<8)
  15. ZPULL        equ    780
  16.  
  17. ****************************************************************************
  18. * Welcome to the actual stars code.
  19. *
  20.  
  21. *****  extern WORD far scrwide;
  22. *****  extern WORD far scrhigh;
  23. *****  extern WORD far delta_x;
  24. *****  extern WORD far delta_y;
  25. *****  extern WORD far delta_z;
  26. *****  extern WORD far spin_x;
  27. *****  extern WORD far spin_y;
  28. *****  extern WORD far spin_z;
  29. *****  extern WORD far CenterX;
  30. *****  extern WORD far CenterY;
  31. *****  extern PLANEPTR far Plane1ptr;
  32. *****  extern PLANEPTR far Plane2ptr;
  33. *****  UWORD StarColors[]={0,0x558,0x88B,0xFFF};
  34.  
  35.  
  36.     CODE,PUBLIC
  37.     xdef @StarOffsets
  38.     xdef _ComputeStarField
  39.     xdef _DisplayStarField
  40. *****    VOID __regargs StarOffsets(ULONG mod_d0);
  41. *****    VOID ComputeStarField();
  42. *****    VOID DisplayStarField();
  43.  
  44.     xdef    _scrwide
  45.     xdef    _scrhigh
  46.     xdef    _delta_x
  47.     xdef    _delta_y
  48.     xdef    _delta_z
  49.     xdef    _spin_x
  50.     xdef    _spin_y
  51.     xdef    _spin_z
  52.     xdef    _CenterX
  53.     xdef    _CenterY
  54.     xdef    _Plane1ptr
  55.     xdef    _Plane2ptr
  56.  
  57. @StarOffsets   ; Computes 480 screen offsets
  58.     move.l    d2,-(sp)
  59.  
  60.     move.l    #199,d2
  61.     lea        YOffTable,a0
  62.     moveq.l    #0,d1
  63.  
  64. 1$    move.l    d1,(a0)+
  65.     add.l    d0,d1
  66.     dbra        d2,1$
  67.  
  68.     move.l    (sp)+,d2
  69.     rts
  70.  
  71. _ComputeStarField
  72.     movem.l    d2-d7/a2-a6,-(SP)
  73.     bsr        AddSpins
  74.     bsr        GenMat
  75.     bsr        Transform
  76.     bsr.s    MoveStars
  77.     movem.l    (SP)+,d2-d7/a2-a6
  78.     rts
  79.  
  80. _DisplayStarField
  81.     movem.l    d2-d7/a2-a6,-(SP)
  82.     bsr.s    EraseStars
  83.     ;    bsr        DrawStars    ;Fall thru to this routine
  84.     movem.l    (SP)+,d2-d7/a2-a6
  85.     rts
  86.  
  87. ****************************************************************************
  88. * Move the stars
  89. *
  90. MoveStars    lea        XCoords(pc),a0
  91.         lea        YCoords(pc),a1
  92.         lea        ZCoords(pc),a2
  93.         move.w    _delta_x(pc),d0
  94.         move.w    _delta_y(pc),d1
  95.         move.w    _delta_z(pc),d2
  96.         move.w    #BOXRANGE,d4
  97.         moveq    #NSTARS-1,d7
  98.  
  99. 0$        move.w    (a0),d3
  100.         add.w    d0,d3        ; Add move delta
  101.         cmp.w    #MAXBOX,d3    ; Too big?
  102.         bgt.s    1$
  103.         cmp.w    #MINBOX,d3    ; Too small?
  104.         bge.s    2$
  105.         add.w    d4,d3        ; Wrap up
  106.         bra.s    2$
  107. 1$        sub.w    d4,d3        ; Wrap down
  108. 2$        move.w    d3,(a0)+
  109.  
  110.         move.w    (a1),d3
  111.         add.w    d1,d3
  112.         cmp.w    #MAXBOX,d3
  113.         bgt.s    11$
  114.         cmp.w    #MINBOX,d3
  115.         bge.s    22$
  116.         add.w    d4,d3
  117.         bra.s    22$
  118. 11$        sub.w    d4,d3
  119. 22$        move.w    d3,(a1)+
  120.  
  121.         move.w    (a2),d3
  122.         add.w    d2,d3
  123.         cmp.w    #MAXBOX,d3
  124.         bgt.s    111$
  125.         cmp.w    #MINBOX,d3
  126.         bge.s    222$
  127.         add.w    d4,d3
  128.         bra.s    222$
  129. 111$        sub.w    d4,d3
  130. 222$        move.w    d3,(a2)+
  131.  
  132.         dbra    d7,0$
  133.  
  134.         rts
  135.  
  136.  
  137. ****************************************************************************
  138. * Star rendering routines.
  139. *
  140. * This too has undergone a re-write since 1.0.  A BSET instruction is now
  141. * used to plot the star directly into the bitmap.  The Y-offset into the
  142. * bitmap is now fetched from a pre-computed table to save on a multiply.
  143. * A change to the in-memory representation of the projected points saved
  144. * a few cycles in memory fetches.  Further, rendering is now done with bytes
  145. * rather than words (since BSETs to memory are only byte-wide); any loss on
  146. * higher-order processors is made up for by the faster clock.
  147. *
  148. * EraseStars underwent a kooky change since it appears to be the blocking
  149. * factor for clean rendering on a 68000.  Getting even faster would mean
  150. * major towering, which falls under the law of diminshing returns.
  151. *
  152. EraseStars
  153.         moveq    #0,d0
  154.         move.l    _Plane1ptr(pc),a1
  155.         move.l    _Plane2ptr(pc),a2
  156.         lea        PlaneOffsets,a4
  157.         moveq    #(NSTARS>>1)-1,d7    ; As the programmer :-), I
  158.                     ;  guarantee the count will be even
  159.  
  160. 1$        move.l    (a4)+,d1    ; Grab two offsets
  161.         move.b    d0,0(a1,d1.l)    ; Blast entire byte
  162.         move.b    d0,0(a2,d1.l)
  163.         move.l    (a4)+,d1
  164.         move.b    d0,0(a1,d1.l)    ; Blast entire byte
  165.         move.b    d0,0(a2,d1.l)
  166.         dbra    d7,1$
  167.  
  168. DrawStars    lea        TransformBuff,a0    ; Coords in YXZ order
  169.         lea        YOffTable,a1
  170.         lea        PlaneOffsets,a3
  171.         move.l    _Plane1ptr(pc),a2
  172.         move.l    _Plane2ptr(pc),a4
  173.         moveq    #NSTARS-1,d7
  174.         move.w    _scrhigh(pc),d4
  175.         move.w    _scrwide(pc),d5
  176. NextDraw    move.w    (a0)+,d1    ; Load and check Y value
  177.         bmi.s    clipped_y
  178.         cmp.w    d4,d1
  179.         bge.s    clipped_y
  180.  
  181.         move.w    (a0)+,d0    ; Load and check X value
  182.         bmi.s    clipped_x
  183.         cmp.w    d5,d0
  184.         bge.s    clipped_x
  185.  
  186.         moveq.l    #0,d2
  187.         move.w    d0,d2
  188.         not.w    d0        ; Invert X for BSET bit positon
  189.         lsr.l    #3,d2        ; Compute byte offset in line
  190.         lsl.l    #2,d1
  191.         move.l    0(a1,d1.w),d1    ; Get Y offset from table
  192.         add.l    d1,d2
  193.         move.l    d2,(a3)+    ; Store computed offset
  194.         move.w    (a0)+,d6    ; Load Z
  195.         cmp.w    #-176,d6    ; Z closer than this?
  196.         ble.s    1$        ; No, draw just plane 1 (dim)
  197.  
  198.         bset        d0,0(a4,d2.l)    ; This plane definitely gets written
  199.         cmp.w    #130,d6        ; Very close?
  200.         ble.s    2$        ; No
  201. 1$        bset        d0,0(a2,d2.l)    ;    Yes; draw brightest value
  202. 2$
  203.         dbra        d7,NextDraw
  204.  
  205.         rts
  206.  
  207. clipped_y    addq.w    #2,a0        ; Skip unread x
  208. clipped_x    addq.w    #2,a0        ; Skip unread z
  209.         clr.l    (a3)+
  210.         dbra        d7,NextDraw
  211.  
  212.         rts
  213.  
  214.  
  215. ****************************************************************************
  216. * This is the biggie.
  217. *
  218. * This has been completely re-written, and where the biggest speed gains
  219. * were realized.  It used to be three discrete rotations.  Now it's a full
  220. * matrix operation.
  221. *
  222. * The source XYZ values are loaded into D0-D2.  The resulting XYZ values are
  223. * left in D3-D5.  The matrix is stored in column-major ZYX order.  This is
  224. * done to facilitate early rejection of Z values behind the camera (though
  225. * I don't yet make use of that).
  226. *
  227. * The matrix elements are in 2.14 bit fixed-point notation.  The numbers in
  228. * the coordinate array are straight integers.
  229. *
  230. Transform    lea        XCoords(pc),a0
  231.         lea        YCoords(pc),a1
  232.         lea        ZCoords(pc),a2
  233.         lea        TransformBuff,a4
  234.         moveq    #NSTARS-1,d7
  235.         move.l    #MAGIC,d6
  236.         move.w    #ZPULL,a5    ; Being used for storage
  237.  
  238.     ;------    Load vertex and matrix.
  239. NextStar    move.w    (a0)+,d0    ; Fetch X, Y, and Z
  240.         move.w    (a1)+,d1
  241.         move.w    (a2)+,d2
  242.         lea        Matrix(pc),a3    ; Fetch matrix
  243.  
  244.     ;------    Multiply vertex through matrix.
  245.     ;------    First column is Z.
  246.         move.w    d0,d5        ; X
  247.         muls        (a3)+,d5    ;   * *mat++
  248.         move.w    d1,d4        ; Y
  249.         muls        (a3)+,d4    ;   * *mat++
  250.         add.l    d4,d5        ;        Accumulate to D5
  251.         move.w    d2,d4        ; Z
  252.         muls        (a3)+,d4    ;   * *mat++
  253.         add.l    d4,d5        ;        Accumulate to D5
  254.         swap        d5
  255.         rol.l    #2,d5        ; D5 >>= 14;
  256.  
  257.     ;------    Second column is Y.
  258.         move.w    d0,d4        ; X
  259.         muls        (a3)+,d4    ;   * *mat++
  260.         move.w    d1,d3        ; Y
  261.         muls        (a3)+,d3    ;   * *mat++
  262.         add.l    d3,d4        ;        Accumulate to D4
  263.         move.w    d2,d3        ; Z
  264.         muls        (a3)+,d3    ;   * *mat++
  265.         add.l    d3,d4        ;        Accumulate to D4
  266.         swap        d4
  267.         rol.l    #2,d4        ; D4 >>= 14;
  268.  
  269.     ;------    Third column is X.
  270.         move.w    d0,d3        ; X
  271.         muls        (a3)+,d3    ;   * *mat++
  272.         move.w    d1,d0        ; Y (original X no longer needed)
  273.         muls        (a3)+,d0    ;   * *mat++
  274.         add.l    d0,d3        ;        Accumulate to D3
  275.         move.w    d2,d0        ; Z
  276.         muls        (a3)+,d0    ;   * *mat++
  277.         add.l    d0,d3        ;        Accumulate to D3
  278.         swap        d3
  279.         rol.l    #2,d3        ; D3 >>= 14;
  280.  
  281. ****************
  282. * Here is performed the perspective projection.
  283. *
  284. * Normally, this is accomplished by dividing both X and Y by the Z
  285. * coordinate.  However, in this case, only one division is performed to
  286. * calculate a fixed-point scaling factor, which is then multiplied by the
  287. * X and Y values.  This is done because multiplication is cheaper than
  288. * division.  The perspective scalar is:
  289. *
  290. *        MAGIC
  291. *    -------------
  292. *    - (Z - ZPULL)
  293. *
  294. * The subtraction from Z is to "pull" the stars away from the camera (which
  295. * is at Z == 0) so that they'll be visible.  The negation effectively flips
  296. * the Z axis, which makes the calculation easier (trust me).  MAGIC and
  297. * ZPULL are currently set to 256 and 780 respectively.  The 256 is a number
  298. * I pulled out of Thin Air.  (So's the 780, for that matter...)  Feel free
  299. * to play with them to see what happens.
  300. *
  301. * The projected points are stored in YXZ order.
  302. *
  303.     ;------    Compute scalar.
  304.         move.l    d6,d0        ; MAGIC
  305.         move.w    a5,d1        ; ZPULL
  306.         sub.w    d5,d1        ;    - Z
  307.         ble.s    BehindCamera
  308.         divu        d1,d0        ; == 256 / (ZPULL - Z)
  309.         bvs.s    BehindCamera    ; Shunt wild division
  310.  
  311.     ;------    Multiply scalar by X and Y components.
  312.         move.w    d4,d1        ; Y
  313.         muls        d0,d1        ;   * 256 / (ZPULL - Z)
  314.         lsr.l    #8,d1        ; (Unavoidable.  Ack!)
  315.           lsr.l     #1,d1
  316.         add.w    _CenterY(pc),d1
  317.         move.w    d1,(a4)+    ; Y store
  318.  
  319.         move.w    d3,d1        ; X
  320.         muls        d0,d1        ;   * 256 / (ZPULL - Z)
  321.         lsr.l    #8,d1
  322.         add.w    _CenterX(pc),d1
  323.         move.w    d1,(a4)+    ; X store
  324.  
  325.         move.w    d5,(a4)+    ; Z store (for pixel brightness)
  326.  
  327.         dbra        d7,NextStar
  328.  
  329.         rts
  330.  
  331.     ;------    Whoops!  Behind the camera.  Force an invisible point.
  332. BehindCamera
  333.         moveq    #-1,d1
  334.         move.l    d1,(a4)+    ; X and Y store
  335.         move.w    d5,(a4)+    ; Z store
  336.         dbra        d7,NextStar
  337.  
  338.         rts
  339.  
  340.  
  341.  
  342. ****************************************************************************
  343. * Generate a matrix.
  344. *
  345. * This routine generates a three-rotation matrix all at once, in ZYX order.
  346. * Rotations are anti-clockwise.
  347. *
  348. GenMat    move.w    theta_z(pc),d0    ; Collect sines and cosines
  349.         bsr        SinCos
  350.         move.w    d0,d4        ; sinZ
  351.         move.w    d1,d5        ; cosZ
  352.         move.w    theta_y(pc),d0
  353.         bsr        SinCos
  354.         move.w    d0,d2        ; sinY
  355.         move.w    d1,d3        ; cosY
  356.         move.w    theta_x(pc),d0
  357.         bsr        SinCos
  358.  
  359.         lea    Matrix(pc),a0    ; Point at matrix
  360.  
  361.     ;------    Compute first column Z.
  362.     ;------    sinX * sinZ - cosX * sinY * cosZ
  363.         move.w    d0,d7        ; sinX
  364.         muls        d4,d7        ;      * sinZ
  365.         move.w    d1,d6        ; cosX
  366.         muls        d2,d6        ;      * sinY
  367.         swap        d6
  368.         rol.l    #2,d6
  369.         move.w    d6,a1        ;        (Save for later)
  370.         muls        d5,d6        ;           * cosZ
  371.         sub.l    d6,d7
  372.         swap        d7
  373.         rol.l    #2,d7        ; D7 >>= 14
  374.         move.w    d7,(a0)+    ;            (Store)
  375.  
  376.     ;------    sinX * cosZ + cosX * sinY * sinZ
  377.         move.w    d0,d6        ; sinX
  378.         muls        d5,d6        ;      * cosZ
  379.         move.w    a1,d7        ; cosX * sinY
  380.         muls        d4,d7        ;          * sinZ
  381.         add.l    d6,d7
  382.         swap        d7
  383.         rol.l    #2,d7
  384.         move.w    d7,(a0)+    ;            (Store)
  385.  
  386.     ;------    cosX * cosY
  387.         move.w    d1,d7        ; cosX
  388.         muls        d3,d7        ;      * cosY
  389.         swap        d7
  390.         rol.l    #2,d7
  391.         move.w    d7,(a0)+    ;            (Store)
  392.  
  393.     ;------    Compute second column Y.
  394.     ;------    cosX * sinZ + sinX * sinY * cosZ
  395.         move.w    d1,d7        ; cosX
  396.         muls        d4,d7        ;      * sinZ
  397.         move.w    d0,d6        ; sinX
  398.         muls        d2,d6        ;      * sinY
  399.         swap        d6
  400.         rol.l    #2,d6
  401.         move.w    d6,a1        ;        (Save for later)
  402.         muls        d5,d6        ;          * cosZ
  403.         add.l    d6,d7
  404.         swap        d7
  405.         rol.l    #2,d7
  406.         move.w    d7,(a0)+    ;            (Store)
  407.  
  408.     ;------    cosX * cosZ - sinX * sinY * sinZ
  409.         move.w    d1,d7        ; cosX
  410.         muls        d5,d7        ;      * cosZ
  411.         move.w    a1,d6        ; sinX * sinY
  412.         muls        d4,d6        ;          * sinZ
  413.         sub.l    d6,d7
  414.         swap        d7
  415.         rol.l    #2,d7
  416.         move.w    d7,(a0)+    ;            (Store)
  417.  
  418.     ;------    -sinX * cosY
  419.         move.w    d0,d7        ;  sinX
  420.         neg.w    d7        ; -
  421.         muls        d3,d7        ;    * cosY
  422.         swap        d7
  423.         rol.l    #2,d7
  424.         move.w    d7,(a0)+    ;            (Store)
  425.  
  426.     ;------    Compute third column X.
  427.     ;------    cosY * cosZ
  428.         move.w    d3,d7        ; cosY
  429.         muls        d5,d7        ;      * cosZ
  430.         swap        d7
  431.         rol.l    #2,d7
  432.         move.w    d7,(a0)+    ;            (Store)
  433.  
  434.     ;------    -cosY * sinZ
  435.         move.w    d3,d7        ;  cosY
  436.         neg.w    d7        ; -
  437.         muls        d4,d7        ;    * sinZ
  438.         swap        d7
  439.         rol.l    #2,d7
  440.         move.w    d7,(a0)+    ;            (Store)
  441.  
  442.     ;------    sinY
  443.         move.w    d2,(a0)+    ;            (Store)
  444.  
  445.     ;------    Phew!  We're outa here.
  446.         rts
  447.  
  448.  
  449. ****************************************************************************
  450. * Sine/Cosine calculator.  Nothing amazing here, just a table lookup.
  451. *
  452. * This got a lot more complicated for no good reason :-).  The sine/cosine
  453. * table ranges from 0-90°.  The code selects the proper values and negates
  454. * them based on the quadrant in which the angle lies.  2048 == 360 degrees.
  455. * Sine table entries are represented using 14 bit fixed point fractions.
  456. *
  457. * Angle passed in D0.  May now be an odd number.
  458. * Returns sine in D0, cosine in D1.
  459. *
  460. SinCos    move.w    d2,-(sp)
  461.  
  462.         add.w    d0,d0        ; Word offset
  463.         lea        SineTable(pc),a5
  464.         move.w    d0,d2        ; Copy
  465.         and.w    #1024-1,d0    ; Clip to 90°
  466.         move.w    #1024,d1    ; d0 == ang
  467.         sub.w    d0,d1        ; d1 == gna
  468.  
  469.         move.w    0(a5,d0.w),d0    ; Fetch sine candidate
  470.         move.w    0(a5,d1.w),d1    ; Fetch cosine candidate
  471.  
  472.     ;------    Determine which is sine and which is cosine.
  473.         lsl.w    #5,d2        ; Shift quadrant bits into Carry and
  474.                     ;  Minus flags.
  475.         bpl.s    1$        ; First or third quadrant?
  476.         exg        d0,d1        ; Yes, exchange values
  477. 1$
  478.     ;------    Is sine negative?
  479.         bcc.s    2$        ; Third or fourth quadrants?
  480.         neg.w    d0        ; Yes, negate si(g)ne
  481.  
  482.     ;------    Is cosine negative?  We test for this two ways, depending on
  483.     ;------    the result of the previous test.
  484.         tst.w    d2        ; Quadrant 3?
  485.         bpl.s    88$        ; Yes, negate cosine
  486.         bra.s    99$
  487.  
  488. 2$        tst.w    d2        ; Quadrant 2?
  489.         bpl.s    99$
  490. 88$        neg.w    d1        ; Yes, negate cosine
  491.  
  492. 99$        move.w    (sp)+,d2
  493.         rts
  494.  
  495.  
  496. ****************************************************************************
  497. * Add spins to current rotation angles.  Clip to 360° circle.
  498. *
  499. AddSpins    move.w    #2048-1,d1    ; 360° == 2048 EHG
  500.         lea    theta_x(pc),a0
  501.         lea    _spin_x(pc),a1
  502.  
  503.         move.w    (a0),d0        ; Get angle
  504.         add.w    (a1)+,d0    ; Add spin
  505.         and.w    d1,d0        ; Clip to 360°
  506.         move.w    d0,(a0)+    ; Store it back
  507.  
  508.         move.w    (a0),d0
  509.         add.w    (a1)+,d0
  510.         and.w    d1,d0
  511.         move.w    d0,(a0)+
  512.  
  513.         move.w    (a0),d0
  514.         add.w    (a1),d0
  515.         and.w    d1,d0
  516.         move.w    d0,(a0)
  517.  
  518.         rts
  519.  
  520. ****************************************************************************
  521. * Data!  (Yes, Captain?)
  522. *
  523. _delta_x    dc.w    10    ; Star movement
  524. _delta_y    dc.w    5
  525. _delta_z    dc.w    2
  526. theta_x    dc.w    0    ; Initial/current rotation angles
  527. theta_y    dc.w    0
  528. theta_z    dc.w    0
  529. _spin_x    dc.w    4    ; Spin velocities
  530. _spin_y    dc.w    5
  531. _spin_z    dc.w    3
  532.  
  533. wrk_delta    dc.w    0,0,0    ; Working areas for the parser
  534. wrk_theta    dc.w    0,0,0
  535. wrk_spin    dc.w    0,0,0
  536.  
  537. _scrwide    dc.w    320
  538. _scrhigh    dc.w    200
  539.  
  540. CurrentSinCos
  541.         dc.w    0    ; theta_x
  542.         dc.w    0
  543.         dc.w    0    ; theta_y
  544.         dc.w    0
  545.         dc.w    0    ; theta_z
  546.         dc.w    0
  547. Matrix    dc.w    0,0,0,0,0,0,0,0,0
  548. _CenterX    dc.w    160
  549. _CenterY    dc.w    100
  550. _Plane1ptr    dc.l    0
  551. _Plane2ptr    dc.l    0
  552.  
  553. XCoords    dc.w    $FF37,$FED2,$6A,$FFF7,$C8,$CD,$FFF9,$132,$FF35
  554.         dc.w    $FF9A,$FF7F,$16B,$EC,$FFF7,$186,$FF5A,$FF0D,$177
  555.         dc.w    $FEAF,$6F,$FF5F,$FF22,$150,$2B,$FED5,$FEE3,$90,$AA
  556.         dc.w    $FEBE,$13A,$12D,$FFA4,$FF49,$FEEE,$41,$164,$FF09
  557.         dc.w    $8A,$FFE3,$D2,$FEBE,$13A,$12D,$FFA4,$FF49,$FEEE,$41
  558.         dc.w    $164,$FF09,$8A,$FF46,$FF85,$154,$FF19,$60,$FF5C,$9B
  559.         dc.w    $FFA8,$FF18,$158,$AE,$FF2F,$FE72,$21,$8C,$FE8B,$CF
  560.         dc.w    $48,$FF7A,$137,$C8,$FED4
  561. YCoords    dc.w    $FF5F,$FF22,$150,$2B,$FED5,$FEE3,$90,$AA,$FEBE,$13A
  562.         dc.w    $12D,$FFA4,$FF49,$FEEE,$41,$164,$FF09,$8A,$FFE3,$D2
  563.         dc.w    $FF37,$FED2,$6A,$FFF7,$C8,$CD,$FFF9,$132,$FF35
  564.         dc.w    $FF9A,$FF7F,$16B,$EC,$FFF7,$186,$FF5A,$FF0D,$177
  565.         dc.w    $FEAF,$6F,$177,$FEAF,$6F,$FF5F,$FF22,$150,$2B,$FED5
  566.         dc.w    $FEE3,$90,$164,$FF09,$8A,$FFE3,$FF52,$FF2F,$18E,$21
  567.         dc.w    $FF74,$FE8B,$CF,$FFB8,$86,$FEC9,$D2,$FF22,$94,$14D
  568.         dc.w    $FE9B,$F4,$C8,$12C
  569. ZCoords    dc.w    $FF52,$FF2F,$FE72,$21,$8C,$175,$FF31,$FFB8,$FF7A
  570.         dc.w    $137,11,$153,$FF22,$94,$14D,$FE9B,$F4,$FEEC,$9B
  571.         dc.w    $FF46,$FF85,$154,$FF19,$60,$FF5C,$9B,$FFA8,$FF18
  572.         dc.w    $158,$FF61,$FE8F,$F8,$FEE7,$8C,$FF85,$48,$FEAC
  573.         dc.w    $FF17,$6A,$13B,$FF01,$FF3A,$FFF9,7,$BE,$12B,$FED1
  574.         dc.w    $FE94,$FC,$FF91,$CD,$FFF9,$132,$FF35,$FF9A,$FF7F
  575.         dc.w    $16B,$EC,$FFF7,$186,$FED2,$6A,$FFF7,$C8,$CD,$FFF9
  576.         dc.w    $132,$FF35,$FF9A,$FF7F,$96,$FF06
  577.  
  578.  
  579. SineTable    dc.w    0,50,101,151,201,251,302,352
  580.         dc.w    402,452,503,553,603,653,704,754
  581.         dc.w    804,854,904,955,1005,1055,1105,1155
  582.         dc.w    1205,1255,1306,1356,1406,1456,1506,1556
  583.         dc.w    1606,1656,1706,1756,1806,1856,1906,1956
  584.         dc.w    2006,2055,2105,2155,2205,2255,2305,2354
  585.         dc.w    2404,2454,2503,2553,2603,2652,2702,2752
  586.         dc.w    2801,2851,2900,2949,2999,3048,3098,3147
  587.         dc.w    3196,3246,3295,3344,3393,3442,3492,3541
  588.         dc.w    3590,3639,3688,3737,3786,3835,3883,3932
  589.         dc.w    3981,4030,4078,4127,4176,4224,4273,4321
  590.         dc.w    4370,4418,4467,4515,4563,4612,4660,4708
  591.         dc.w    4756,4804,4852,4900,4948,4996,5044,5092
  592.         dc.w    5139,5187,5235,5282,5330,5377,5425,5472
  593.         dc.w    5520,5567,5614,5661,5708,5756,5803,5850
  594.         dc.w    5897,5943,5990,6037,6084,6130,6177,6223
  595.         dc.w    6270,6316,6363,6409,6455,6501,6547,6593
  596.         dc.w    6639,6685,6731,6777,6823,6868,6914,6960
  597.         dc.w    7005,7050,7096,7141,7186,7231,7276,7321
  598.         dc.w    7366,7411,7456,7501,7545,7590,7635,7679
  599.         dc.w    7723,7768,7812,7856,7900,7944,7988,8032
  600.         dc.w    8076,8119,8163,8207,8250,8293,8337,8380
  601.         dc.w    8423,8466,8509,8552,8595,8638,8680,8723
  602.         dc.w    8765,8808,8850,8892,8935,8977,9019,9061
  603.         dc.w    9102,9144,9186,9227,9269,9310,9352,9393
  604.         dc.w    9434,9475,9516,9557,9598,9638,9679,9720
  605.         dc.w    9760,9800,9841,9881,9921,9961,10001,10040
  606.         dc.w    10080,10120,10159,10198,10238,10277,10316,10355
  607.         dc.w    10394,10433,10471,10510,10549,10587,10625,10663
  608.         dc.w    10702,10740,10778,10815,10853,10891,10928,10966
  609.         dc.w    11003,11040,11077,11114,11151,11188,11224,11261
  610.         dc.w    11297,11334,11370,11406,11442,11478,11514,11550
  611.         dc.w    11585,11621,11656,11691,11727,11762,11797,11831
  612.         dc.w    11866,11901,11935,11970,12004,12038,12072,12106
  613.         dc.w    12140,12173,12207,12240,12274,12307,12340,12373
  614.         dc.w    12406,12439,12472,12504,12537,12569,12601,12633
  615.         dc.w    12665,12697,12729,12760,12792,12823,12854,12885
  616.         dc.w    12916,12947,12978,13008,13039,13069,13100,13130
  617.         dc.w    13160,13190,13219,13249,13279,13308,13337,13366
  618.         dc.w    13395,13424,13453,13482,13510,13538,13567,13595
  619.         dc.w    13623,13651,13678,13706,13733,13761,13788,13815
  620.         dc.w    13842,13869,13896,13922,13949,13975,14001,14027
  621.         dc.w    14053,14079,14104,14130,14155,14181,14206,14231
  622.         dc.w    14256,14280,14305,14329,14354,14378,14402,14426
  623.         dc.w    14449,14473,14497,14520,14543,14566,14589,14612
  624.         dc.w    14635,14657,14680,14702,14724,14746,14768,14789
  625.         dc.w    14811,14832,14854,14875,14896,14917,14937,14958
  626.         dc.w    14978,14999,15019,15039,15059,15078,15098,15118
  627.         dc.w    15137,15156,15175,15194,15213,15231,15250,15268
  628.         dc.w    15286,15304,15322,15340,15357,15375,15392,15409
  629.         dc.w    15426,15443,15460,15476,15493,15509,15525,15541
  630.         dc.w    15557,15573,15588,15604,15619,15634,15649,15664
  631.         dc.w    15679,15693,15707,15722,15736,15750,15763,15777
  632.         dc.w    15791,15804,15817,15830,15843,15856,15868,15881
  633.         dc.w    15893,15905,15917,15929,15941,15952,15964,15975
  634.         dc.w    15986,15997,16008,16018,16029,16039,16049,16059
  635.         dc.w    16069,16079,16088,16098,16107,16116,16125,16134
  636.         dc.w    16143,16151,16160,16168,16176,16184,16192,16199
  637.         dc.w    16207,16214,16221,16228,16235,16242,16248,16255
  638.         dc.w    16261,16267,16273,16279,16284,16290,16295,16300
  639.         dc.w    16305,16310,16315,16319,16324,16328,16332,16336
  640.         dc.w    16340,16343,16347,16350,16353,16356,16359,16362
  641.         dc.w    16364,16367,16369,16371,16373,16375,16376,16378
  642.         dc.w    16379,16380,16381,16382,16383,16383,16384,16384
  643.         dc.w    16384
  644.  
  645.         SECTION EuroStars,BSS
  646. StartBSS:
  647.  
  648. TransformBuff    ds.w    NSTARS*3    ; Written in YXZ order
  649. PlaneOffsets    ds.l    NSTARS
  650. YOffTable        ds.l 200
  651.  
  652. EndBSS:
  653.         END
  654.